/* 
 * File:   Character.h
 * Author: paula
 *
 * Created on 8 de septiembre de 2014, 23:26
 */

#ifndef CHARACTER_H
#define	CHARACTER_H


//#include "../Define/DefaultValues.h"
//#include "Object.h"
//#include "ObjFactory.h"
//#include "Dot.h"
//#include "SBSImage.h"

#include <string>
#include <iostream>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include "../Define/DefaultValues.h"
#include "../Define/Structs.h"
#include "../Controller/SBSLog.h"
#include "ClientSocket.h"
#include "SBSImage.h"
#include "Dot.h"
#include "Drawable.h"
#include "Walker.h"

using namespace std;

class Character : public Walker {
public:

    Character();
    Character(int x, int y, SDL_Renderer** gRenderer, int player);
    Character(const Character& orig);
    virtual ~Character();

    void actualize();
    void actualizeState(int state);

    void fallRight();
    void fallLeft();
    void jumpingRight();
    void jumpingLeft();

    void freeMediaGrey();
    void beDead();

private:

    SBSImage* deadJumping;
    SBSImage* deadKneeling;
    SBSImage* deadWaiting;
    SBSImage* deadWalking;
    SBSImage* deadFalling;

    bool dead;

    float windowPixelWidth, windowPixelHeight, windowUnitWidth, windowUnitHeight;
    float posX, posY;
    SBSLog* myLogFile;

    int player;

    bool characterOverlap(int x, int y);

    void jumpRight();
    void jumpLeft();
    void moveRight(float velocityX, float velocityY);
    void moveLeft(float velocityX, float velocityY);

    void loadMediaGrey();

    int lastState;
    float lastPosX;
    float lastPosY;
    bool lastSide;

};

#endif	/* CHARACTER_H */